/**   
 * api接口统一管理
 */
import { get, post } from './http'
/**
 * 封装接口，示例
 * @param {p是我们请求接口时携带的参数对象} p 
 */
export const apiAddress = p => post('api/helloworld',p);
//调用商品列表,p为typeid(服装为1，食品为2)
export const apiGoodsList = p => get('admin/goods/list', p);

//查看添加商品列表,Get类型,p为typeid
export const apiSelectAddList = p => get('api/admin/goods/add',p);
//添加商品列表,Post类型,p为typeid
export const apiAddsList = p => post('api/admin/goods/add',p);

//查看进货,p为商品id：gid
export const apiSelectStockList = p => get('api/admin/goods/stock',p);
//进货，p为gid和count
export const apiStockList = p => post('api/admin/goods/stock',p);

//查看销售记录,p为period和para
export const apiSaleListPage = p => get('api/admin/sale/period/list',p);
//销售情况输出excel，p为period和para
export const apiSaleExport = p => get('api/admin/sale/period/export',p);

//销售页面?p为gid
export const apiBuyPage = p => get('api/admin/sale/simulateBuy',p);
//Buy,p为gid和count
export const apiBuy = p => post('api/admin/sale/simulateBuy',p);
  
//销售记录,p为空,此处语法不正确的话希望董小姐可以帮我改一下
export const apiRecord = p => get('api/admin/sale/simulateBuy',p);

//这个或许是后端之前调搜索页面的接口？p为typeid
export const apiSearchPage = p => get('api/admin/search/typeid',p);
//查找,p:typeid(必须),gname,brand,color,size,crowd,deadline,provenance,starttime,endtime
export const apiSearch = p => post('api/admin/search/typeid',p);

//下架页面？p:gid
export const apiUndercarriagePage = p => get('api/admin/undercarriage/goods',p);
//下架，p:gid,reason
export const apiUndercarriage = p => post('api/admin/undercarriage/goods/gid',p);
//下架列表
export const apiUndercarriageList = p => get('api/admin/undercarriage/list',p);
//商品下架记录，p:gid
export const apiUndercarriageRecovery = p => get('api/admin/undercarriage/recovery/goods',p);
//后端暂时这么多接口，前端如果需要其他功能可以先自己写一下前端接口测试，后端等对接的时候再加
